﻿using CommunityToolkit.Mvvm.ComponentModel;
using Rj_GsInsurance.Client.ControlsLookup;
using Rj_GsInsurance.Client.Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rj_GsInsurance.Client.ViewModels
{
    public partial class AllControlsViewModel : ObservableObject
    {
        [ObservableProperty]
        private ICollection<NavigationCard> _navigationCards = new ObservableCollection<NavigationCard>(
            ControlPages
                .All()
                .Select(x => new NavigationCard()
                {
                    Name = x.Name,
                    Icon = x.Icon,
                    Description = x.Description,
                    PageType = x.PageType
                })
                .OrderBy(x => x.Name)
        );
    }
}
